---
apiVersion: v1
kind: DeploymentConfig
metadata:
  labels:
    app: monitor-gating
  name: monitor-gating
spec:
  replicas: 1
  selector:
    app: monitor-gating
    deploymentconfig: monitor-gating
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: monitor-gating
        deploymentconfig: monitor-gating
    spec:
      hostAliases:
        - hostnames:
          - apps.stg.fedoraproject.org
          ip: 10.3.166.74
      containers:
      - name: monitor-gating
        image: monitor-gating:latest
        resources: {}
        env:
          - name: KRB5_CONFIG
            value: /opt/config/krb5.conf
          - name: KRB5_CLIENT_KTNAME
            value: /etc/keytab/koji-keytab
          - name: OPENSHIFT
            value: "True"
{% if env != "staging" %}
          - name: PRODUCTION
            value: "True"
{% endif %}
        volumeMounts:
        - name: keytab-volume
          mountPath: /etc/keytabs
          readOnly: true
        - name: monitor-gating-secret-volume
          mountPath: /opt/config/
          readOnly: true
        - name: monitor-gating-ssh-volume
          mountPath: /opt/ssh/
          readOnly: true
        - name: fedora-messaging-config-volume
          mountPath: /etc/fedora-messaging
          readOnly: true
        - name: fedora-messaging-ca-volume
          mountPath: /etc/pki/rabbitmq/ca
          readOnly: true
        - name: fedora-messaging-crt-volume
          mountPath: /etc/pki/rabbitmq/crt
          readOnly: true
        - name: fedora-messaging-key-volume
          mountPath: /etc/pki/rabbitmq/key
          readOnly: true
      volumes:
       - name: keytab-volume
         secret:
           secretName: monitor-gating-keytab
       - name: monitor-gating-secret-volume
         secret:
           secretName: monitor-gating-secret
           defaultMode: 0660
           path: id_rsa
       - name: monitor-gating-ssh-volume
         secret:
           secretName: monitor-gating-ssh
           defaultMode: 0660
       - name: fedora-messaging-config-volume
         configMap:
           name: fedora-messaging-configmap
       - name: fedora-messaging-ca-volume
         secret:
           secretName: monitor-gating-fedora-messaging-ca
       - name: fedora-messaging-crt-volume
         secret:
           secretName: monitor-gating-fedora-messaging-crt
       - name: fedora-messaging-key-volume
         secret:
           secretName: monitor-gating-fedora-messaging-key
  triggers:
  - type: ConfigChange
  - type: ImageChange
    imageChangeParams:
      automatic: true
      containerNames:
      - monitor-gating
      from:
        kind: ImageStreamTag
        name: monitor-gating:latest
